package Task1.model;

public class DongCat {

    private int _size;
    private String _diachi;

    public synchronized int getSize() {
        return _size;
    }

    public DongCat() {
        _size = 0;
    }

    public DongCat(int n, String diachi) {
        this._size = n;
        this._diachi = diachi;
    }

   public synchronized int DoThemVao() {
        if (_size < 100) {
            _size++;
            return _size;
        }
        return -1;
    }

    public synchronized int LayDi() {
        if (_size > 0) {
            _size--;
            return _size;
        }
        return -1;
    }

    /**
     * @return the _diachi
     */
    public String get_diachi() {
        return _diachi;
    }

    /**
     * @param _diachi the _diachi to set
     */
    public void set_diachi(String _diachi) {
        this._diachi = _diachi;
    }

}
